package com.duoec.dw.lineage.utils;

import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZoneOffset;
import java.util.Calendar;

/**
 * 时间工具
 *
 * @author: denghong <denghong01@duoec.com>
 * @date: 2020/12/3 10:26
 */
public class DateTool {

    /**
     * 秒格式时间戳转换为LocalDateTime
     *
     * return LocalDateTime
     */
    public static LocalDateTime getDateTimeOfSec(long timestamp) {
        Instant instant = Instant.ofEpochSecond(timestamp);
        ZoneId zone = ZoneId.systemDefault();
        return LocalDateTime.ofInstant(instant, zone);
    }
}
